import React, { Component } from 'react'
import { Route,Redirect } from 'react-router-dom'
import Approve from './Approve'
import Statistics from './Statistics'
import Work from './Work'
import './Leave.css'
import Mytime from './Mytime'
export default class Leave extends Component<any, any> {
    constructor(props: any) {
        super(props)
        this.state = {
            nums: 4
        }
    }
    componentWillMount=()=>{
        this.fun04()
    }
    apply = () => {
        this.props.history.push('/Main/Apply')
    }
    fun01 = () => {
        this.props.history.push('/Main/Leave/Approve')
    }
    fun02 = () => {
        this.props.history.push('/Main/Leave/Statistics')
    }
    fun03 = () => {
        this.props.history.push('/Main/Leave/Work')
    }
    fun04 = () => {
        this.props.history.push('/Main/Leave/Mytime')
    }
    render() {
        return (
            <div>
                <div className='leave'>
                    <div className='hz' onClick={this.fun04}>我的请假</div>
                    <div className='hz' onClick={this.fun01}>请假审批</div>
                    <div className='hz' onClick={this.fun02}>考勤统计</div>
                    <div className='hz' onClick={this.fun03}>考勤时间设置</div>
                </div> 
                <Route path='/Main/Leave/Mytime' component={Mytime}></Route>
                <Route path='/Main/Leave/Approve' component={Approve}></Route>
                <Route path='/Main/Leave/Statistics' component={Statistics}></Route>
                <Route path='/Main/Leave/Work' component={Work}></Route>
            </div>
        )
    }
}
